import pytest,requests
from conftest import login
from untils.data_loader import read_yaml

@pytest.mark.parametrize('data1',read_yaml(r'D:\gaosi_xm\9_8\Data\a.yaml'))
@pytest.mark.login
def test_pay(login,data1):
    sessionId,userId = login
    url = 'http://10.59.9.18/movieApi/movie/v2/verify/buyMovieTickets'
    headers = {'content-type':'application/json','userId':str(userId),'sessionId':sessionId}
    data = {'scheduleId':data1.get('scheduleId'),'seat':['1-1'],'sign':'c1271d431d2594443e9d70f1c94f4112'}
    pay = requests.post(url=url,headers=headers,json=data)
    print(pay.json())
    assert data1.get('exp') == pay.json()['message']
    assert pay.status_code == 200


